<?php
namespace Modules\UI\Http\Controllers\Client\V1;

use Illuminate\Http\Request;
use Illuminate\Routing\Controller;

use Modules\Activity\Entities\Activity;

use Validator;
use ThrowException;

class ActivityHomeController extends Controller
{
    public function show(Request $req)
    {
        $rule = [
        ];
        Validator::make($req->all(), $rule)->fails() && ThrowException::BadRequest(); 

        $options = $req->all();

        $lotteryList = Activity::getList([
        	'scopes' => [
        		'type'  => 'lottery',
                'onStock',
                'recommend'
        	],
        	'per_page' => 3
        ])->getArray();

        $seckillList = Activity::getList([
        	'scopes' => [
        		'type'  => 'seckill',
                'onStock',
                'recommend'
        	],
        	'per_page' => 3
        ])->getArray();

        return [
        	'lottery_list' => $lotteryList,
        	'seckill_list' => $seckillList,
        ];
    }
}
